package com.zsl.swing.redis.desktop.window.menu;

import com.zsl.swing.redis.desktop.type.MainMenuEnum;
import com.zsl.swing.redis.desktop.window.dialog.DbCountConfigDialog;
import com.zsl.swing.redis.desktop.window.dialog.FontSizeSetDialog;
import com.zsl.swing.redis.desktop.window.dialog.OtherGeneralConfigDialog;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

public class ZslOptionMenu extends ZslMenu implements ActionListener {

    public ZslOptionMenu(){
        super(MainMenuEnum.OPTIONS.getText());

        this.add(ZslMenuItem.getInstance(MainMenuEnum.FONT_SIZE_SET.getText(), this));
//        this.add(ZslMenuItem.getInstance(MainMenuEnum.DB_COUNT_SET.getText(), this));
        this.add(ZslMenuItem.getInstance(MainMenuEnum.OTHER_GENERAL_SET.getText(), this));
    }

    @Override
    public void actionPerformed(ActionEvent e) {
        String command = e.getActionCommand();
        if(MainMenuEnum.FONT_SIZE_SET.getText().equals(command)){
            FontSizeSetDialog.showDialog();
        }else if(MainMenuEnum.OTHER_GENERAL_SET.getText().equals(command)){
            OtherGeneralConfigDialog.showDialog();
        }

    }
}
